using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EnemyFlyFish : EnemyBasic
{
    public GameObject missile;
    public float attacktime;
    float attacktimeex;
    // Start is called before the first frame update
    void Start()
    {
        base.Start();
        flip = -1;
        stiffratio = 1f;
        repelratio = 0.1f;
    }

    // Update is called once per frame
    void Update()
    {
        base.Update();
        if (stifftimeex > 0)
        {
            attacktimeex = 0;
        }
        attacktimeex += Time.deltaTime;
        if (player_transform.position.x + deltadistance >= transform.position.x && player_transform.position.x - deltadistance <= transform.position.x)
        {
            if (attacktimeex >= attacktime)
            {
                attacktimeex = 0;
                Instantiate(missile, transform.position, Quaternion.identity);
            }
        }
        transform.position = new Vector3(transform.position.x,13f);
        
    }
}
